package com.coldfusiondocs.model.presentation
{
    import com.coldfusiondocs.model.LinkModel;
    
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    
    import mx.collections.ArrayCollection;
    
    public class LinkPresentationModel extends EventDispatcher
    {
        
        // PROPERTIES
        
        [Dispatcher]public var dispatcher : IEventDispatcher;
        
		[Inject(source="linkModel")]
		public var linkModel:LinkModel;
		
		[Inject(source="linkModel.all_links", bind="true")]
		[Bindable]public var all_links:ArrayCollection;
		
		[Inject(source="linkModel.currentState", bind="true")]
		[Bindable]public var currentState : String = LinkModel.STATE_LOADING;	
		
		[Bindable]public var currentItem:String = "";
		
		[Bindable]
		public var isIframeVisible:Boolean = false;
		
		[Bindable]
		public var iframeURL:String = "";	
		
		public function changeView(num:Number):void
		{
			switch(num)
			{
				case 1:
				{
					this.currentState = LinkModel.STATE_ADD;
					break;
				}

				case 2:
				{
					this.currentState = LinkModel.STATE_READY;
					break;	
				}
				
				case 3:
				{
					this.currentState = LinkModel.STATE_LOADING;
					break;
				}
			}
		}		
		
    }
}